﻿@model Pay.TO.PagedResult<Pay.DTO.order_dto>
    @if (Model.rows != null && Model.rows.Count > 0) {
        foreach (var item in Model.rows) {
            <div class="order_detail_box">
                <div class="order_detail_box">
                    @item.merchant.name
                    <span class="states">@Pay.Core.EnumExtensions.ToDescription((item.status))</span>
                </div>
                @if (item.order_items != null && item.order_items.Count > 0) {
                    foreach (var items in item.order_items) {
                        var src = (ViewData["url"] as string) + items.thumbnails_url;
                <div class="order_detail" id="assDlist">
                    <a href="/Order/OrderDetail/?Id=@item.id">
                        <img src="@src" alt="">
                        <section class="order_detil_box">
                            <h1 class="proTit">@items.product_name</h1>
                            <p></p>
                        </section>
                        <div class="order_price"><span>￥@items.unit_price</span> </div>

                        <section class="order_ment">
                            <div class="ments">
                                共 @item.order_items.Sum(x => x.quantity) 件商品

                            </div>
                            <div class="dikou">总计(不含税) : <span>￥@item.pay_amount</span></div>
                        </section>
                    </a>
                    @if (item.status == Pay.TO.OrderStatus.WaitPay) {
                <div class="btnesBox">
                    <input type="button" onclick="Pay('@item.pay_info.order_no')" value="去付款" class="immeBtn">
                    <input type="button" onclick="cancel('@item.id')" value="取消订单" class="cellationBtn" id="trigger1">
                </div>
}
                    @if (item.status == Pay.TO.OrderStatus.Shipped) {
                <div class="btnesBox">
                    <input type="button" onclick="Receipt('@item.id')" value="确认收货" class="immeBtn">
                    <input type="button" value="查看物流" onclick="wuliu(@item.pay_info.plateid,@item.pay_info.id)" class="cellationBtn" id="trigger1">
                </div>
}
                </div>

                    }
                }
            </div>

        }
    }
    <page rows="@Model.rows.Count()" total_result="@Model.total_result"></page>

